﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Simulatore_0._1
{
    public partial class Login:Form
    {

        public string username { get; private set; }
        public string password { get; private set; }
        public MainView vista;

        public Login (MainView vista)
        {
            this.vista=vista;
            InitializeComponent();
        }

        private void button1_Click_1 ( object sender, EventArgs e )
        {
            string username1 = "test";
            string password1 = "test";

            if(textBox1.Text.CompareTo(username1)==0 && textBox2.Text.CompareTo(password1)==0)
            {
                MessageBox.Show("Benvenuto "+username1+"!", "Login", MessageBoxButtons.OK,MessageBoxIcon.Exclamation);

                //si visualizzano i valori aggiuntivi
                vista.label17.Visible=true;
                vista.label18.Visible=true;
                vista.label19.Visible=true;
                vista.textBox14.Visible=true;
                vista.textBox13.Visible=true;
                vista.textBox4.Visible=true;

                vista.lineShape1.Visible=true;
                vista.lineShape2.Visible=true;
                vista.lineShape3.Visible=true;
                vista.lineShape4.Visible=true;
                vista.lineShape5.Visible=true;
                this.Close();
            }
            else
            {
                MessageBox.Show("Incorrect username or password", "Bad credentials", MessageBoxButtons.OK,MessageBoxIcon.Error);
                this.Close();
            }
        }
    }
}
